import React from 'react';
import { List, Tag } from 'antd';
import { useNavigate } from 'react-router-dom';
import styles from '../styles/components.less';

const AnnouncementList: React.FC = () => {
  const navigate = useNavigate();

  const data = [
    {
      id: '1',
      title: '关于开展2024年度档案预验收工作的通知',
      type: '验收通知',
      time: '2024-03-15'
    },
    {
      id: '2',
      title: '2023年度档案管理工作总结会议通知',
      type: '会议通知',
      time: '2024-03-14'
    },
    {
      id: '3',
      title: '关于加强档案数字化建设的指导意见',
      type: '工作指导',
      time: '2024-03-13'
    }
  ];

  return (
    <List
      className={styles.announcementList}
      dataSource={data}
      renderItem={(item) => (
        <List.Item 
          onClick={() => navigate(`/announcement/${item.id}`)}
          style={{ cursor: 'pointer' }}
        >
          <List.Item.Meta
            title={item.title}
            description={
              <div className={styles.itemFooter}>
                <Tag color="blue">{item.type}</Tag>
                <span>{item.time}</span>
              </div>
            }
          />
        </List.Item>
      )}
    />
  );
};

export default AnnouncementList; 